<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!--		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />-->
		<title>互动</title>



		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="./css/font.css">
		<link rel="stylesheet" href="./css/xadmin.css">
		<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="./js/xadmin.js"></script>


		<link href="client/css/mui.min.css" rel="stylesheet" />
		<link href="client/css/build.css" rel="stylesheet" type="text/css" />
		<script src="client/js/mui.min.js"></script>
		<style>
			.layui-form-label{
				padding: 9px 0px;
				width: 60px;

			}
		</style>
	</head>
	<body>
	
	<img src="client/images/zixun_img.jpg" style="width: 100%;">

	<div class="mui-content">

		<div class="mui-control-content mui-active hudong_box padding_0_15">

			<div class="title flex-space-between flex-between-center">
				<a href="/myfeed.html" th:if="${session.client!=null && msg!=''}">我的咨询></a>
			</div>

			<form class="layui-form" id="myform" method="post" action="/addcontent">
				<div class="layui-form-item">
					<label for="username" class="layui-form-label" >
						<span class="x-red">*</span>姓名
					</label>
					<div class="layui-input-inline">
						<input type="text" id="username" name="username" required="" lay-verify="required"
							   autocomplete="off" class="layui-input">
					</div>
				</div>

				<div class="layui-form-item">
					<label for="username" class="layui-form-label" >
						<span class="x-red">*</span>单位
					</label>
					<div class="layui-input-inline">
						<input type="text" id="unit" name="unit" required="" lay-verify="required"
							   autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label for="phone" class="layui-form-label" >
						<span class="x-red">*</span>手机号
					</label>
					<div class="layui-input-inline">
						<input type="text" id="phone" name="phone" required="" lay-verify="phone"
							   autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label for="username" class="layui-form-label" >
						<span class="x-red">*</span>email
					</label>
					<div class="layui-input-inline">
						<input type="text" id="email" name="email" required="" lay-verify="required"
							   autocomplete="off" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label for="username" class="layui-form-label" >
						<span class="x-red">*</span>留言类型
					</label>
					<div class="layui-input-inline">
						<select id="type" name="type" class="valid">
							<option value="0">咨询</option>
							<option value="1">投诉</option>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label for="username" class="layui-form-label" >
						<span class="x-red">*</span>是否开放
					</label>
					<div class="layui-input-inline">
						<select name="state">
							<option value="1">开放</option>
							<option value="0">不开放</option>
						</select>
					</div>
				</div>

				<div class="layui-form-item layui-form-text">
					<label style="width: 100%;text-align: center;color: #1E9FFF" for="content" class="layui-form-label">
						--问题描述--
					</label>
					<div class="layui-input-block" style="width: 80%;margin: 0 auto">
						<textarea placeholder="请输入内容" id="content" name="content" class="layui-textarea"></textarea>
					</div>
				</div>
					<center>
						<div  class="layui-form-item" >
							<label class="layui-form-label">
							</label>
							<button type="button" style="width: 100%;text-align: center;background-color: #1E9FFF" id="butn"  class="layui-btn">提交</button>
						</div>
					</center>
			</form>
		</div>
		<!-- 底部信息-->
		<div class="footer_box">
			<div class="footer_txt">
				<p>版权所有：中国民用航空局</p>
				<p>ICP备案编号：京ICP备19046468号</p>
			</div>
		</div>

		<!-- 底部tabbar    start -->
		<nav class="mui-bar mui-bar-tab tabbar-bottom">
			<a class="mui-tab-item" onclick="window.location.href='/selectAllLaws'">
				<span class="mui-icon"><img src="/client/images/nav_home.png" /></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item mui-active" onclick="window.location.href='/hudongAdd'">
				<span class="mui-icon"><img src="/client/images/nav_hudong_on.png" /></span>
				<span class="mui-tab-label">咨询</span>
			</a>
			<a class="mui-tab-item" onclick="window.location.href='/user.html'">
				<span class="mui-icon"><img src="/client/images/nav_user.png" /></span>
				<span class="mui-tab-label">我的</span>
			</a>
		</nav>
		<!-- 底部tabbar    end -->


		<script type="text/javascript">

			mui.init();

		</script>
	</div>
	</body>
	<script>

		layui.use(['form','layer'], function(){
			$ = layui.jquery;
			var form = layui.form
					,layer = layui.layer;

			//自定义验证规则
			form.verify({
				nikename: function(value){
					if(value.length < 5){
						return '昵称至少得5个字符啊';
						``     }
				}
				,pass: [/(.+){6,12}$/, '密码必须6到12位']
				,repass: function(value){
					if($('#L_pass').val()!=$('#L_repass').val()){
						return '两次密码不一致';
					}
				}
			});

			//监听提交
			form.on('submit(add)', function(data){
				console.log(data);
				//发异步，把数据提交给php
				var myform = document.getElementById("myform");
				myform.submit();
				layer.alert("增加成功", {icon: 6},function () {
					// 获得frame索引
					var index = parent.layer.getFrameIndex(window.name);
					//关闭当前frame
					parent.layer.close(index);
				});
				return false;
			});
		});

		$(function () {
			$("#butn").click(function () {
				var myfor = $("#myform");
				let jQuery = myfor.serialize();
				location="/addcontent?"+jQuery;
			});
		});
	</script>
<!--	<script>var _hmt = _hmt || []; (function() {-->
<!--		var hm = document.createElement("script");-->
<!--		hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";-->
<!--		var s = document.getElementsByTagName("script")[0];-->
<!--		s.parentNode.insertBefore(hm, s);-->
<!--	})();</script>-->
</html>
